//
//  EditProductDefImgCell.m
//  AFNetworking
//
//  Created by admin on 2020/5/6.
//

#import "EditProductDefImgCell.h"

@implementation EditProductDefImgCell

-(instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]) {
        [self confitUI];
    }
    return self;
}

-(void)confitUI{

    [self addSubview:self.imageView];
     [self addSubview:self.deleteBtn];
}

-(UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [UIImageView new];
        [_imageView ug_radius:4];
    }
    return _imageView;
}
-(UIButton *)deleteBtn{
    if (!_deleteBtn) {
        _deleteBtn = [UIButton new];
        [_deleteBtn setImage:UGIMAGE(@"icon_sc") forState:UIControlStateNormal];

    }
    return _deleteBtn;
}

-(void)layoutSubviews{
    [super layoutSubviews];

    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self);
        make.left.mas_equalTo(self);
        make.right.mas_equalTo(self);
        make.bottom.mas_equalTo(self);
    }];
    [_deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self).mas_offset(6);
        make.top.mas_equalTo(self).mas_offset(-6);
        make.size.mas_equalTo(CGSizeMake(13, 13));
        
    }];
}

@end
